package game.controlling;
import java.util.TreeMap;
/**
 * Provides functions that assign each player in the game a controller. That controller is : LocalController when the player is controlled by this client/server NetworkController when the player is controlled by a client KiControler otherwise
 * 
 * @author toni
 * 
 */
public class ControllerManager {
	TreeMap<Integer, Controller> map;
	public ControllerManager() {
		map = new TreeMap<Integer, Controller>();
	}
	public Controller get(int playerId) {
		return map.get(playerId);
	}
	public void set(int playerId, Controller controller) {
		map.put(playerId, controller);
	}
	public void handle() {
		for (Controller c : map.values()) {
			c.clear();
		}
	}
}
